package com.hayden.fileMonitor.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
public class ConfigFileReader {
    private static final Logger LOGGER = LoggerFactory.getLogger(ConfigFileReader.class);
    private Properties props;
    public ConfigFileReader() {
        props = new Properties();
        try (InputStream in = new FileInputStream("config.properties")) {
            props.load(in);
        } catch (IOException ex) {
            LOGGER.error("配置文件写入失败，请检查配置文件路径：",ex);
        }
    }
    public String getProperty(String key) {
        return props.getProperty(key);
    }
    public String getProperty(String key,String value){
        return props.getProperty(key,value);
    }
}
